package com.bzkj.basicinfo.service.stock.impl;

import com.bzkj.basicinfo.domain.stock.WmsStockLogEntity;
import com.bzkj.basicinfo.mapper.stock.WmsStockLogMapper;
import com.bzkj.common.core.page.TableDataInfo;
import com.bzkj.basicinfo.service.stock.WmsStockLogService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;

@Service
public class WmsStockLogServiceImpl implements WmsStockLogService {

    @Autowired
    private WmsStockLogMapper stockLogMapper;

    @Override
    public TableDataInfo getStockLogList(WmsStockLogEntity entity, int pageNum, int pageSize) {
        PageHelper.startPage(pageNum, pageSize);
        List<WmsStockLogEntity> list = stockLogMapper.selectStockLogList(entity);
        PageInfo<WmsStockLogEntity> pageInfo = new PageInfo<>(list);
        TableDataInfo dataTable = new TableDataInfo();
        dataTable.setCode(200);
        dataTable.setMsg("查询成功");
        dataTable.setRows(list);
        dataTable.setTotal(pageInfo.getTotal());
        return dataTable;
    }
}
